package jwt

import (
	"time"

	jwt "gitee.com/sansaniot/ssiot-core/httpmvc/jwtauth"
)

// AuthInit jwt验证new
func AuthInit() (*jwt.GinJWTMiddleware, error) {
	return jwt.New(&jwt.GinJWTMiddleware{
		Realm:           "ssalarm",
		Key:             []byte(""),
		IdentityHandler: IdentityHandler,
		Authorizator:    Authorizator, //仅在身份验证成功后。 成功时必须返回 true，失败时返回 false
		TokenLookup:     "header: Authentication, header: token, cookie: token",
		TokenHeadName:   "",
		SendCookie:      false,
		TimeFunc:        time.Now,
	})

}
